<template>
  <div class="right-card-2">
    <HeaderTitle :imgUrl="`mineralOutput-img`" />
    <div @click="add">{{ modelValue }}</div>
    <div class="card-body" id="right-card-2-conter"></div>
  </div>
</template>

<script setup>
import * as echarts from 'echarts';
import { onMounted } from 'vue';

const option = {
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    itemWidth: 20, // 设置图例项的宽度
    itemHeight: 5, // 设置图例
    icon: 'rect',
    data: [{ name: '资源量' }, { name: '储量' }]
  },
  grid: {
    top: '15%',
    left: '0%',
    right: '6%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    type: 'category',
    data: ['石家庄', '邢台', '张家口', '邯郸', '秦皇岛', '承德', '保定']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: '资源量',
      type: 'bar',
      stack: 'Total',
      data: [120, 132, 101, 134, 90, 132, 101]
    },
    {
      name: '储量',
      type: 'bar',
      stack: 'Total',
      data: [820, 932, 901, 934, 1290, 820, 932]
    }
  ]
};
onMounted(() => {
  const myChart = echarts.init(document.getElementById('right-card-2-conter'), null, {
    renderer: 'canvas',
    useDirtyRect: false
  });
  myChart.setOption(option);
});
</script>
